package com.siants.itemprocessor;/**
 * 〈一句话功能简述〉<br>
 * 〈〉
 *
 * @author yanxin
 * @create 2018/9/25
 * @since 1.0.0
 */

import com.siants.dao.Comtrx;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

import javax.sound.midi.Soundbank;

/**
 * Created by yanxin on 2018/9/25.
 */
public class ComtrxMapper implements FieldSetMapper<Comtrx> {

    @Override
    public Comtrx mapFieldSet(FieldSet fieldSet) throws BindException {
        if(fieldSet == null){
            return null;
        }

        Comtrx comtrx = new Comtrx();
        comtrx.setA(fieldSet.readString("a"));
        comtrx.setB(fieldSet.readString("b"));
       /* comtrx.setFirstName(fs.readString("firstName"));
        comtrx.setPosition(fs.readString("position"));
        comtrx.setDebutYear(fs.readInt("debutYear"));
        comtrx.setBirthYear(fs.readInt("birthYear"));*/
        System.out.println(comtrx.getA());
        return comtrx;
    }

}
